<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib prefix="user" uri="/WEB-INF/tlds/userName.tld" %>
<%@include file="/WEB-INF/views/include/head.jsp" %> 
<html>
<head>
<meta name="decorator"  content="moduleList" />
<script type="text/javascript" src="${staticPath}/lib/jquery/1.10.2/jquery.js"></script>
<script type="text/javascript"> 
	function funform(url,target){
		window.open(url,target);
	}
	 
</script>
 
</head>
<body> 
	  	<tags:message content="${message}"/>
	  <form:form name="listForm" action="" modelAttribute="supplier" method="post" class="form-inline" role="form">
		<table class="table table-striped table-hover o-l-table" id="table1">
		<thead>
		</thead> 
			<thead>
				<tr>
					<th>主题</th>
					<th>流程定义</th>
					<th>流程状态</th>
					<th>创建人</th>
					<th>创建时间</th>
					<th>当前处理</th>
					<th>当前处理人</th>
					<th>查看</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${page.list}" var="processInstance">
					<tr>
						<td>${processInstance.subject}</td>
						<td>${processInstance.procDefName}</td>
						<td>
							<ossp:value dictType="FLOW_STATUS" key="${processInstance.flowStatus}"></ossp:value>
						</td>
						<td>
							<user:username userId="${processInstance.createBy}"/>
						</td>
						<td><fmt:formatDate value="${processInstance.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
						<td>${processInstance.curTasksName}</td>
						<td>${processInstance.curTasksUserName}</td>
						<td>
							<c:if test="${processInstance.flowStatus ne 'draft'}">
								<a href="#" onclick="funform('${contextPath}/bpm/bpmsap/processView/${processInstance.instanceId}/${processInstance.bpmnInstId}/${processInstance.bpmnDefId}/${processInstance.processDefId}?flowStatus=${processInstance.flowStatus}','_blank');">查看</a>
							</c:if>
							
							<c:if test="${processInstance.flowStatus eq 'draft'}">
								<a href="${contextPath}/bpm/bpmsap/delete/${processInstance.instanceId}" target="_blank">删除</a>
							</c:if>
						</td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
		  	<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}" url="" total="${page.total}"/>
			<script type="text/javascript" src="${staticPath}/js/list.js"></script> 
		</form:form>
</body>
</html>